1. Field of the Invention
The present invention relates to a numerical control apparatus capable of bringing a tool cutting edge of a tool mounted on a tool rest into contact with a cutting edge abutting surface of a touch sensor to detect the tool cutting edge, and setting a tool compensation amount from a cutting edge position when the tool cutting edge is detected.
2. Description of the Related Art
In a machining processing of a workpiece using a numerical control apparatus, a cutting edge position of a tool mounted on a tool rest is different in some cases from a reference position set in advance as a result of tool exchanges or the like. The numerical control apparatus executes a work program on the precondition that the cutting edge of the tool is on the reference position, but if the work program is executed while leaving the error between the cutting edge position and the reference position as it is, the machining precision is deteriorated. When the position error is great, the tool and the machine tool interfere with each other, and a problem may be caused in the machining operation itself.
Hence, in the numerical control apparatus, before the machining operation is carried out, a cutting edge position with respect to a machine original point of a tool used for the machining operation is detected by a tool cutting edge detector mounted on the machine tool, a tool compensation value is calculated from the difference between the detected cutting edge position and a cutting edge position when a reference tool is mounted, and the tool compensation value is inputted to the numerical control apparatus, thereby correcting the work program and executing the work program.
There is a known machine tool in which a tool mounted on a tool rest is brought into contact with a touch sensor to detect a cutting edge position, and a tool compensation value is calculated from a difference between the detected cutting edge position and a cutting edge position when a reference tool is mounted, and the tool compensation value is set.
FIG. 5 is a block diagram used for explaining one example (see Japanese Patent Application Laid-open No. 8-25180) of a structure for detecting a tool cutting edge in a conventional numerical control apparatus. FIG. 6 is a flowchart used for explaining procedure for obtaining the tool compensation amount by a structure which detects the tool cutting edge shown in FIG. 5.
In the block diagram in FIG. 5, in a numerical control apparatus 100, a controller 10 controls a drive unit 11 to drive a tool 16. A tool cutting edge 17 is mounted on the tool 16 to machine a workpiece (not shown). A touch sensor 2a comprises a cutting edge abutting surface 2b, and when the tool cutting edge 17 comes into contact with the cutting edge abutting surface 2b, a switch mechanism or the like outputs a detection signal. The contact detector 2c detects this detection signal and detects that the tool cutting edge 17 comes into contact with the cutting edge abutting surface 2b, and sends the detection signal to a tool coordinate value reading unit 13.
A position detector 12 detects a position of the tool cutting edge 17 from position data of a tool drive shaft. Tool coordinate values when the position is detected are sent to the tool coordinate value reading unit 13 in succession.
An operator drives the tool toward the touch sensor at a low speed (step S11), and brings the tool cutting edge 17 into contact with the cutting edge abutting surface 2b of the touch sensor 2a. If the tool cutting edge 17 comes into contact with the cutting edge abutting surface 2b of the touch sensor 2a and a switch is operated (step S12), the contact detector 2c detects the contact (step S13).
If the contact detector 2c informs the tool coordinate value reading unit 13 that the tool cutting edge 17 comes into contact with the cutting edge abutting surface 2b of the touch sensor 2a, the tool coordinate value reading unit 13 obtains the tool compensation value at that time (step S14). The numerical control apparatus 100 calculates the difference between data of the tool coordinate value at that time and position data obtained when the reference tool comes into contact with the touch sensor in advance, as a tool compensation value (step S15), and sets the tool compensation amount in a tool compensation memory 15 of the numerical control apparatus (step S16).
When the tool compensation amount is actually set, however, the touch sensor intermittently reacts a plurality of times and outputs a plurality of detection signals due to impact when vibration of the machine or a tool comes into contact with the touch sensor, or due to impact when the tool is separated from the touch sensor after the tool comes into contact with the touch sensor, and signal input to the numerical control apparatus is carried out a plurality of times continuously in some cases.
The numerical control apparatus calculates the tool compensation value whenever the detection signal generated when the touch sensor reacts is inputted, and registers the tool compensation value in the tool compensation memory. Therefore, a control apparatus is determined by a detection signal which is inputted lastly, and there is a problem that a precise tool compensation amount can not be obtained in some cases.
When the machine tool comprises a plurality of touch sensors or when one touch sensor is provided with a plurality of cutter abutting surfaces which come into contact with the cutting edge of a tool, a tool comes into contact with a touch sensor other than one that should originally detect or with a cutter abutting surface other than one which should detect in some cases when the tool rest is being moved or when the tool comes into contact with the touch sensor.
When the tool comes into contact with wrong touch sensor or cutter abutting surface, the detection signal is an erroneous detection signal, and if a tool compensation amount is calculated based on such erroneous detection signal, there is a problem that a precise tool compensation amount can not be obtained.